home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Dylan Related / Mindy / Mindy 1.2 - portable sources / interp / list.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-15  |  1.8 KB  |  55 lines  |  [TEXT/ttxt]

  1. /**********************************************************************\
  2. *
  3. *  Copyright (c) 1994  Carnegie Mellon University
  4. *  All rights reserved.
  5. *  
  6. *  Use and copying of this software and preparation of derivative
  7. *  works based on this software are permitted, including commercial
  8. *  use, provided that the following conditions are observed:
  9. *  
  10. *  1. This copyright notice must be retained in full on any copies
  11. *     and on appropriate parts of any derivative works.
  12. *  2. Documentation (paper or online) accompanying any system that
  13. *     incorporates this software, or any part of it, must acknowledge
  14. *     the contribution of the Gwydion Project at Carnegie Mellon
  15. *     University.
  16. *  
  17. *  This software is made available "as is".  Neither the authors nor
  18. *  Carnegie Mellon University make any warranty about the software,
  19. *  its performance, or its conformity to any specification.
  20. *  
  21. *  Bug reports, questions, comments, and suggestions should be sent by
  22. *  E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
  23. *
  24. ***********************************************************************
  25. *
  26. * $Header: list.h,v 1.3 94/10/05 21:03:47 nkramer Exp $
  27. *
  28. \**********************************************************************/
  29.  
  30.  
  31. struct list {
  32.     obj_t class;
  33.     obj_t head;
  34.     obj_t tail;
  35. };
  36.  
  37. #define LIST(o) obj_ptr(struct list *, o)
  38.  
  39. #define HEAD(l) (LIST(l)->head)
  40. #define TAIL(l) (LIST(l)->tail)
  41.  
  42. extern obj_t obj_ListClass, obj_EmptyListClass, obj_PairClass;
  43. extern obj_t obj_Nil;
  44.  
  45. extern obj_t pair(obj_t head, obj_t tail);
  46. extern boolean memq(obj_t o, obj_t list);
  47. extern obj_t nreverse(obj_t list);
  48. extern int length(obj_t list);
  49.  
  50. extern obj_t list1(obj_t x);
  51. extern obj_t list2(obj_t x, obj_t y);
  52. extern obj_t list3(obj_t x, obj_t y, obj_t z);
  53. extern obj_t listn _ANSI_ARGS_((int n, ...));
  54.  
  55.